package com.lwlk.zdk.interceptor;

import org.springframework.stereotype.Component;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpServletRequest;

public class InitListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent event) {
        //获取全局域 servletcontext
        ServletContext servletContext = event.getServletContext();
        System.out.println("我监听到服务器启动了");
        servletContext.setAttribute("initParam","initParam");
    }
}
